<?php
/**
 * Created by PhpStorm.
 * User: function
 * Date: 2018-05-03
 * Time: 18:23
 */

namespace app\api\controller\v1;

use app\common\controller\Api;
use app\common\logic\Logic;
use app\common\logic\MallLogic;
class Score extends Api
{
    public function index(){
        
        $params = paramForm();
        $logic = new Logic();
        $logic->setValue('modelClass','app\common\model\Score');
        $logic->setValue('column','goods_id');
        $logic->setValue('with','user');
        $logic->setValue('paginate',1);
        $scores = $logic->getList($params);
        $mallLogic = new MallLogic();
        foreach ($scores as $score){
            $score->specs = $mallLogic->getMallSpec($score->mall_id);
        }
        success($scores);
    }
    
}